package com.woniu.supermarket.mapper;

import com.woniu.supermarket.entity.Goods;
import com.woniu.supermarket.vo.GoodsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Repository
public interface GoodsMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Goods goods);

    Goods selectByPrimaryKey(Integer id);

    List<Goods> selectAll();

    int updateByPrimaryKey(Goods record);

    //批量删除
    int deleteBatchGoods(int[] ids);

    //分页查询
    List<GoodsVo> selectGoodsByCons(@Param("name") String name, @Param("cid") Integer typeId);

    @Select("select id from g_goods where code = #{value}")
    int getGidByCode(String code);

    int updateByCode(GoodsVo goodsvo);

    int updateByGid(GoodsVo goodsvo);
}